#include<bits/stdc++.h>
using namespace std;

int n;
double num[6]={10,1e5,1e6,1e7,1e5,1e5};
char files[10][20]={"testin/0.in","testin/1.in","testin/2.in","testin/3.in","testin/4.in","testin/5.in"};

int main(){
    ios::sync_with_stdio(false);

    for(int i=0;i<=3;i++){
        freopen(files[i],"w",stdout);
        cout<<(int)num[i]<<endl;
        for(int j=1;j<=num[i];j++) cout<<rand()<<' ';
        cout<<endl;
        fclose(stdout);
    }

    n = 1e5;
	freopen("testin/4.in", "w", stdout);
	cout << n << endl;
	for(int i = 1; i <= n; ++i) cout << i << ' ';
	cout << endl;
	fclose(stdout);
	
	n = 1e5;
	freopen("testin/5.in", "w", stdout);
	cout << n << endl;
	for(int i = n; i >= 1; --i) cout << i << ' ';
	cout << endl;
	fclose(stdout);

	n = 1e5;
	
	freopen("testin/6.in", "w", stdout);
	cout << n << endl;
	for(int i = 10000; i >= 1; --i) for(int j=1;j<=10;j++) cout << i << ' ';
	cout << endl;
	fclose(stdout);
}